package com.kanshu.ksgb.fastread.doudou.module.download.retrofit;

import com.kanshu.ksgb.fastread.doudou.common.net.bean.BaseResult;
import com.kanshu.ksgb.fastread.doudou.common.net.retrofit.FormObjConverterFactory;
import com.kanshu.ksgb.fastread.doudou.common.net.retrofit.Obj;
import com.kanshu.ksgb.fastread.doudou.module.book.retrofit.requestparams.ChapterRequestParams;
import com.kanshu.ksgb.fastread.doudou.module.download.bean.DownLoadChapterBean;
import com.kanshu.ksgb.fastread.doudou.module.download.bean.DownloadRequestParams;
import com.kanshu.ksgb.fastread.doudou.module.download.bean.MakeMoneyBean;
import com.kanshu.ksgb.fastread.doudou.module.download.bean.SimpleBookInfo;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * 作者    wcy
 * 时间    2018/12/6 9:09
 * 文件    doudou
 * 描述
 */
public interface DownloadChapterService {
    // 书籍下载-获取章节分组
    @GET("app/chapter/download_chapter")
    Observable<BaseResult<List<DownLoadChapterBean>>> getDownloadChapter(@Query("book_id") String book_id);

    // 用户书籍下载-扣费
    @FormUrlEncoded
    @POST("app/chapter/download_make")
    Observable<BaseResult<MakeMoneyBean>> downloadMake(@Field("book_id") String book_id, @Field("chapter_ids") String chapter_ids);

    // 章节内容
    @GET("app/chapter/download_content")
    Call<ResponseBody> downChapterContent(@Query(value = FormObjConverterFactory.PLACEHOLDER) @Obj DownloadRequestParams params);

    // 获取所有下载书籍信息
    @GET("app/chapter/download_book")
    Observable<BaseResult<List<SimpleBookInfo>>> getDownloadBookInfo();
}
